﻿using Polaris.Domain.Model.Dto.Permissions.Request;
using Polaris.Domain.Model.Dto.Permissions.Response;
using Polaris.Domain.Model.Dto.Sys_Menu.Response;
using Polaris.Domain.Model.Entity.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Polaris.Domain.Interfaces.Admin
{
    public interface IPermissions
    {
        /// <summary>
        /// 创建角色
        /// </summary>
        /// <param name="create"></param>
        /// <param name="userId"></param>
        public Task CreateRole(CreateRoleInfoRequest create, Guid? userId);

        /// <summary>
        /// 修改角色
        /// </summary>
        /// <param name="update"></param>
        /// <param name="userId"></param>
        public Task UpdateRole(UpdateRoleInfoRequest update, Guid? userId);

        /// <summary>
        /// 删除角色
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="userId"></param>
        public Task DeleteRoleAsync(string roleId, Guid? userId);

        /// <summary>
        /// 获取角色列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public Task<List<RoleInfoResponse>> GetRoleList();

        /// <summary>
        /// 获取所有角色
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public Task<List<RoleOptionsResponse>> GetRoleAllList();

        /// <summary>
        /// 授权菜单给角色
        /// </summary>
        /// <param name="request"></param>
        /// <param name="userId"></param>
        public Task GrantMenuToRole(AllocationMenuRequest request, Guid? userId);

        /// <summary>
        /// 根据角色id获取授权菜单id
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        public Task<List<string>> GetMenuIdsById(string roleId);

        /// <summary>
        /// 获取用户菜单列表
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public Task<List<MenuNode>> GetUserMenuList(Guid userId);
    }
}
